<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.Date"%>
<%@page import="weaver.hrm.User"%>
<%@page import="com.weaver.formmodel.mobile.manager.MobileUserInit"%>
<%@page import="weaver.cowork.CoworkItemMarkOperation"%>
<%@page import="java.util.List"%>
<%@page import="weaver.cowork.CoworkLabelVO"%>
<%@page import="weaver.cowork.CoTypeComInfo"%>
<%@page import="weaver.general.Util"%>
<%@page import="weaver.systeminfo.SystemEnv"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="CoTypeRight" class="weaver.cowork.CoTypeRight" scope="page"/>
<%
	User user = MobileUserInit.getUser(request, response);
	if(user == null){
		out.println("服务器端重置了登录信息，请重新登录");
		return;
	}
	String v = new Date().getTime()+"";
	int detailCoworkId = Util.getIntValue(Util.null2String(request.getParameter("detailid")));
%>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<script type="text/javascript">
	if(typeof(Mobile_NS) == 'undefined'){
		Mobile_NS = {};
	}
	var userid = "<%=user.getUID()%>";
	</script>
	
    <link rel="stylesheet" href="/mobilemode/apps/cowork2/css/appHomepage.css?v=2016_08_25_01" >
    
	<script src="/mobilemode/js/zepto/zepto.min_wev8.js?v=2016_08_25_01"></script>
	<script src="/mobilemode/js/fastclick/fastclick.min_wev8.js?v=2016_08_25_01"></script>
	<script src="/mobilemode/apps/e-cology/js/iscroll-min.js?v=2016_08_25_01"></script>
	<script src="/mobilemode/js/zepto/toucher_wev8.js?v=2016_08_25_01"></script>
	<script src="/mobilemode/js/mec/run/form/FCheckbox_wev8.js?v=2016_08_25_01"></script>
	<script src="/mobilemode/apps/cowork2/js/appHomepage.js?v=2018_12_27_01"></script>
	<script src="/mobilemode/apps/cowork2/js/showbrowser_wev8.js?v=2016_08_25_01"></script>

</head>
<body>
<div id="st-container">
<div class="st-pusher">
	<input type="hidden" id="detailCoworkId" name="detailCoworkId" value="<%=detailCoworkId %>" >
	<div id="main-panel" <%if(detailCoworkId>0){%>class="hide"<%} %> >
		<div class="header">
			<ul class="tab">
				<li class="selected" ctype="all">全部协作</li>
				<li ctype="unread">未读协作</li>
				<li ctype="important">关注协作</li>
				<!--<li id ="labelli" style="white-space: nowrap;text-overflow: ellipsis;">标签</li>-->
			</ul>
			<div id="addCowork" class="right addBtn"></div>
		</div>
		
		<div id="NMEC_C67BC88322500001C79A1F3015CE1C9C" class="listContainerWrap">
		
			<div class="listSearch">
				<form disabledentersubmit="">
					<img src="/mobilemode/apps/e-cology/images/searchright_wev8.gif" class="btn">
					<input class="searchKey" type="search" placeholder="Search...">
					<a onclick="toShowSearch()" class="as_btn"><div class="line one"></div><div class="line two"></div><div class="line three"></div></a>
				</form>
			</div>
			
			<div class="scroll_wrapper">
				<div class="scroll_scroller">
					<div id="pullDown" class="loading">
						<span class="pullDownIcon"></span><span class="pullDownLabel">下拉可以刷新</span>
					</div>
					<ul id="listC67BC88322500001C79A1F3015CE1C9C" class="listContainer" swipetype="1" swipe="true">
					</ul>
					<div class="mec_refresh_loading">
						<div class="spinner">
							<div class="bounce1"></div>
							<div class="bounce2"></div>
							<div class="bounce3"></div>
						</div>
					</div>
					<div id="moreC67BC88322500001C79A1F3015CE1C9C" class="moreData_btn" onclick="pageList();">加载更多</div>
					<div id="nodataC67BC88322500001C79A1F3015CE1C9C" class="nodata_border"><div class="nodata_content"><div class="nodata_img"></div>没有可显示的数据</div></div>
				
				</div>
			</div>
		</div>
	</div>
	
	<!-- 新建协作 -->
	<div id="add-panel" class="hide">
		<form id="addPanelForm">
			<div class="detailHeader">
				<div class="headerLeft">新建</div>
				<div id="addCoworkOk" class="headerRight okBtn"></div>
			</div>
			<div class="coworkDataContainer">	
				<div class="form_msg"></div>
				<div class="coworkFormContainer">
					<table class="tableContainer">
						<colgroup>
							<col width="20%">
							<col width="80%">
						</colgroup>
						<tbody>
							<tr class="intervalTR">
								<td colspan="2">
									<table class="tableContainer">
										<colgroup>
											<col width="50%">
											<col width="50%">
										</colgroup>
										<tbody>
											<tr class="groupHeadHide">
												<td class="interval">
													<span class="groupbg"> </span>
													<span class="e8_grouptitle">基本信息</span>
												</td>
												<td class="interval" colspan="2" style="text-align:right;">
													<span id="baseDataContainer" _status="0" class="hideBlockDiv" style="color: rgb(204, 204, 204);">
														<!-- <img src="/mobilemode/apps/e-cology/images/up_wev8.png"> -->
													</span>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
						 	</tr>
						 	<tr style="height:1px;" id="baseDataLine">
								<td class="line" colspan="2"></td>
							</tr>
							<tr id="baseDataFieldContainer" class="items intervalTR" style="display:table-row;">
								<td colspan="2">
									<table class="tableContainer">
										<colgroup>
											<col width="120px">
											<col width="*">
										</colgroup>
										<tbody>
											<tr>
												<td class="fieldName" colspan="1">主题<span class="requiredCls">*</span></td>
												<td class="field" colspan="1">
													<input datatype="text" class="InputStyle" size="30" value="" id="name" name="name"/>
												</td>
											</tr> 
											<tr class="trLineCla">
												<td class="paddingLeft18" colspan="2">
													<div class="intervalDivClass"></div>
												</td>
											</tr>
											<tr>
												<td class="fieldName" colspan="1">板块<span class="requiredCls">*</span></td>
												<td class="field" colspan="1" id="chooseTypeid">
													<input type="hidden" name="typeid" id="typeid" value=""/>
													<span id="typeidspan" name="typeidspan" class="browserSpanCls"></span>
													<div class="selectBrowsers"></div>
												</td>
											</tr>
											<tr class="trLineCla">
												<td class="paddingLeft18" colspan="2">
													<div class="intervalDivClass"></div>
												</td>
											</tr>
											<tr>
												<td class="fieldName" colspan="1">允许申请</td>
												<td class="field" colspan="1">
													<div id="allowApply" class="FCheckContainer toggle">
														<div class="toggle-handle"></div>
													</div>
													<input type="hidden" id="isApply" name="isApply" value=""/>
												</td>
											</tr>
											<tr class="trLineCla">
												<td class="paddingLeft18" colspan="2">
													<div class="intervalDivClass"></div>
												</td>
											</tr>
											<tr>
												<td class="fieldName" colspan="1">负责人<span class="requiredCls">*</span></td>
												<td class="field" colspan="1" id="chooseTxtPrincipalid" >
													<input type="hidden" id="txtPrincipal" name="txtPrincipal" value=""/>
													<span id="txtPrincipalidSpan" name="txtPrincipalidSpan" class="browserSpanCls"></span>
													<div class="selectBrowsers" type="1"></div>
												</td>
											</tr> 
										</tbody>
									</table>
								</td>
							</tr>
							<tr style="height:1px;">
								<td class="line" colspan="2"></td>
							</tr>
							<tr class="intervalTR" _samepair="" style="display:">
								<td colspan="2">
									<table class="LayoutTable" style="width:100%;">
										<colgroup>
											<col width="50%">
											<col width="50%">
										</colgroup>
										<tbody>
											<tr class="groupHeadHide">
												<td class="interval">
													<span class="groupbg"> </span>
													<span class="e8_grouptitle">参与者</span>
												</td>
												<td class="interval" colspan="2" style="text-align:right;">
													<span id="addConBtn" class="toolbar" style="margin-right:10px;">
														<div class="addbtn"></div>
													</span>
												</td>
											</tr>
										</tbody>
									</table>
								 </td>
							 </tr>
							 <tr style="height:1px;">
								<td class="line" colspan="2"></td>
							 </tr>
							 <tr id="coworkConData" class="items intervalTR" style="display:table-row;">
								<td colspan="2">
									<table class="tableContainer">
										<colgroup>
											<col width="30%">
											<col width="30%">
											<col width="30%">
											<col width="10%">
										</colgroup>
										<thead>
											<tr>
												<td>参与类型</td>
												<td>内容</td>
												<td>安全级别</td>
												<td></td>
											</tr>
										</thead>
										<tbody>
										</tbody>
							 		</table>
							 	</td>
							 </tr>
							 <tr class="intervalTR" _samepair="" style="display:">
								<td colspan="2">
									<table class="LayoutTable" style="width:100%;">
										<colgroup>
											<col width="50%">
											<col width="50%">
										</colgroup>
										<tbody>
											<tr class="groupHeadHide">
												<td class="interval">
													<span class="groupbg"> </span>
													<span class="e8_grouptitle">详细说明</span>
												</td>
												<td class="interval" colspan="2" style="text-align:right;">
													
												</td>
											</tr>
										</tbody>
									</table>
								 </td>
							 </tr>
							 <tr style="height:1px;">
								<td class="line" colspan="2"></td>
							 </tr>
							 <tr class="items intervalTR" style="display:table-row;">
								<td colspan="2">
									<table class="tableContainer">
										<tbody>
											<tr>
												<td>
													<textarea id="remark" name="remark" class="needsclick" rows="" cols=""></textarea>
												</td>
											</tr>
										</tbody>
							 		</table>
							 	</td>
							 </tr>
						 </tbody>
					</table>
				</div>
			</div>
		</form>
	</div>
	
	<!-- 板块 -->
	<div id="add-plate-panel" class="hide">
		<div class="detailHeader">
			<div class="headerLeft">新建</div>
		</div>
		<div class="plateDataContainer">	
			<div class="plateOptionContainer">
				<% 
					int index = 0;
					rs.executeSql("select id,typename from cowork_types order by id asc");
					while(rs.next()){
						String tmptypeid=Util.null2String(rs.getString("id"));
					    String typename=Util.null2String(rs.getString("typename"));
					    int sharelevel = CoTypeRight.getRightLevelForCowork(""+user.getUID(),tmptypeid);
					    if(sharelevel==0) continue;
					    index++;
				%>
					<div class="typeItem" attrVal="<%=tmptypeid%>">
						<span><%=typename%></span>
						<div></div>
					</div>
				<%}%>
			</div>
		</div>
	</div>
	
	<!-- 添加参与条件 -->
	<div id="add-con-panel" class="hide">
		<div class="detailHeader">
			<div class="headerLeft">参与条件</div>
			<div id="addConOk" class="headerRight okBtn"></div>
		</div>
		<div class="coworkConDataContainer">	
			<div class="coworkConFormContainer">
				<table class="tableContainer">
					<colgroup>
						<col width="120px">
						<col width="*">
					</colgroup>
					<tbody>
						<tr>
							<td class="fieldName">参与类型</td>
							<td class="field">
								<div class="selectContainer">
									<select id="sharetype" name="sharetype" onchange="controlCoworkCondition(this);" style="width:100%;height:25px;border: none;">
										<option value="1" selected="selected">人员</option>
										<option value="2">分部</option>
										<option value="3">部门</option>
										<option value="4">角色</option>
										<option value="6">岗位级别</option>
										<option value="5">所有人</option>
									</select>
								</div>
							</td>
						</tr>
						<tr>
							<td class="fieldName">内容<span class="requiredCls" id="shareRequire">*</span></td>
							<td class="field" id="shareContainer">
								<div>
									<input type="hidden" id="shareid" name="shareid" value=""/>
									<span id="shareidSpan" name="shareidSpan" class="browserSpanCls"></span>
									<div class="selectBrowsers"></div>
								</div>
							</td>
						</tr>
						<tr>
							<td class="fieldName">安全级别</td>
							<td class="field">
								<div id="seclevelContainer" style="display:none;">
									<input datatype="text" class="InputStyle" style="width:30%" value="" id="seclevel" name="seclevel"/>-
									<input datatype="text" class="InputStyle" style="width:30%" value="" id="seclevelMax" name="seclevelMax"/>
								</div>
								<div id="jobContainer" style="display:none;">
									<select id="jobtitlelevel" name="jobtitlelevel" onchange="controlJobDept(this)" style="width:100%;height:25px;">
										<option value="0" selected="selected">总部</option>
										<option value="1">指定部门</option>
										<option value="2">指定分部</option>
									</select>
								</div>
							</td>
						</tr>
						<tr id="jobDeptContainer" style="display: none;">
							<td class="fieldName"></td>
							<td class="field" id="chooseJobtitlescopeidSpan">
								<input type="hidden" id="jobtitlescopeid" name="jobtitlescopeid" value=""/>
								<span id="jobtitlescopeidSpan" name="jobtitlescopeidSpan" class="browserSpanCls"></span>
								<div class="selectBrowsers"></div>
							</td>
						</tr>
					</tbody>
				</table> 	
			</div>
		</div>
	</div>
	
	<div id="label-panel" class="label-panel">
		<div class="pageTitle">搜索标签</div>
		<div class="divlabel">
		</div>
		<div class="mec_refresh_loading">
			<div class="spinner">
				<div class="bounce1"></div>
				<div class="bounce2"></div>
				<div class="bounce3"></div>
			</div>
		</div>
	</div>
	
	<div id="detail-panel" <%if(detailCoworkId<=0){%>class="hide"<%} %>>
		<div class="detail-wrap">
			<div class="scroll_scroller" >
				<div class="topTitle">
					<div id="coworkRemarkToggle"></div>
					<div id="approvalAtatus"></div>
					<!-- 
					<div class="searchTitleIcon" onclick="doHistoryBack();"></div>
					 -->
					<div id="divCoworkName" onclick="showDivCoworkRemark(event);"></div>
					<div id="divCoworkSub" onclick="showDivCoworkRemark(event);">
						创建者: <span id="spanCoworkcreate"></span>, 负责人: <span id="spanCoworkprincipal"></span>, 起止时间: <span id="spanCoworkbegindate"></span> 至 <span id="spanCoworkenddate"></span>
						<img id="divCoworkSubImg" src="/mobilemode/apps/cowork2/imgs/retract02.png">
					</div>
					<div id="divCoworkRemark"><div id="spanCoworkemark">协作详细</div></div>
				</div>
				
				<div style="background-color:#f0f0f0;display: none;"><textarea name="spanCoworkeContent" id="spanCoworkeContent" class="spanCoworkeContent needsclick" ></textarea><div id="btnSubmit" onclick="submitContent();">提交</div></div>
				
				
				<div class="tabContainer">
					<div class="tabTitle">
						<ul>
							<li class="selected" href="#tabPage1">相关交流</li>
							<li href="#tabPage2">@与我相关</li>
							<li href="#tabPage3">参与情况</li>
						</ul>
					</div> 
					<div class="tabContent"> 
						<div class="tabPage selected" id="tabPage1">
							<div id="NMEC_C6B12BEF94100001482E16E014907120" class="listContainerWrap">
								<ul id="listC6B12BEF94100001482E16E014907120" class="listContainer">
								</ul>
								<div class="mec_refresh_loading">
									<div class="spinner">
										<div class="bounce1"></div>
										<div class="bounce2"></div>
										<div class="bounce3"></div>
									</div>
								</div>
								<div id="moreC6B12BEF94100001482E16E014907120" class="moreData_btn" onclick="pageCoworkDetailList();">加载更多</div>
								<div id="nodataC6B12BEF94100001482E16E014907120" class="nodata_border"><div class="nodata_content"><div class="nodata_img"></div>没有可显示的数据</div></div>
							</div>
						</div> 
						<div class="tabPage" id="tabPage2">
							<div id="NMEC_C6B12BF0785000015656441342C3A8F0" class="listContainerWrap">
								<ul id="listC6B12BF0785000015656441342C3A8F0" class="listContainer">
								</ul>
								<div class="mec_refresh_loading">
									<div class="spinner">
										<div class="bounce1"></div>
										<div class="bounce2"></div>
										<div class="bounce3"></div>
									</div>
								</div>
								<div id="moreC6B12BF0785000015656441342C3A8F0" class="moreData_btn" onclick="pageMyCoworkDetailList();">加载更多</div>
								<div id="nodataC6B12BF0785000015656441342C3A8F0" class="nodata_border"><div class="nodata_content"><div class="nodata_img"></div>没有可显示的数据</div></div>
							</div>
						</div> 
						<div class="tabPage" id="tabPage3">
							<div id="NMEC_C6B12C4B9980000114D326A01BB01B19">
								<div class="mec_refresh_loading">
									<div class="spinner">
										<div class="bounce1"></div>
										<div class="bounce2"></div>
										<div class="bounce3"></div>
									</div>
								</div>
								<div class="joinCowork">
									<span id="spanajoin1"></span>
									<span id="spanajoin2"></span>
									<span id="spanajoin3"></span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="detail-footer hide hide2">
			<div class="Design_Reply_Container" id="replyDivContainerC6B12C5505500001C9F284801DC077D0" isdefault="0">
				<form class="Design_Reply_Form" method="post" action="/mobilemode/apps/cowork2/CoworkOperation.jsp?operation=doremark" isSubmit="0" onSubmit="return false;">
					<input type="text" class="Design_Reply_Content" name="content" data-role="none" placeholder="回复内容...">
					<input type="hidden" name="userid" value="<%=user.getUID()%>">
					<input type="hidden" name="extendField" value="" paramkey="extendField">
				</form>
				<div class="Design_Reply_Btn" title="提交" onclick="submitReply();">提交</div>
			</div>
		</div>
		<div class="detail-go-top" onclick="moveToTop();">
			<div class="left-line"></div>
			<div class="right-line"></div>
		</div>
	</div>
	
	<!------------搜索条件部分------------->
	<div id="searchDiv" class="hide">
		<div class="detail-wrap">
			<div class="scroll_scroller">
				<div id="coworkRemarkToggle"></div>
				<div id="approvalAtatus"></div>
				<!-- 
				<div class="searchTitleIcon" onclick="doHistoryBack()"></div>
				 -->
				<div class="searchTitle" onclick="doHistoryBack()">协作查询</div>
				<div class="tabContainer">
				
				<div class="Design_FInputText_Field Formfield-Wrap " id="divC6EF00816D20000172D58600D18A81D0">
					<div class="Design_FInputText_Fieldlabel Formfield-Label">标题 :</div>
					<div class="Design_FInputText_Fielddom Formfield-Content">
						<input class="needsclick" placeholder="请输入..." type="text" name="fieldname_title" id="C6EF00816D20000172D58600D18A81D0" value="" data-role="none" fieldlabel="标题 :" require="">
						<div class="Design_FInputText_FieldSub" id="fieldSubC6EF00816D20000172D58600D18A81D0"></div>
					</div>
				</div>

				<div id="divC6EEEF6248B00001D0A9145013F01B74"
					class="Design_FCheckbox_Field ">
					<div class="Design_FCheckbox_Fieldlabel Formfield-Label">标签 :</div>
					<div class="Design_FCheckbox_Fielddom FCheckBoxLayouthorizontal">
						<div cb-type="0" class="FCheckboxContainer">
							<ul id="myCoworkLabelUl">
									<li readonly="0" class="" data-value="all"><div>所有</div></li>
									<%
									String userid = user.getUID()+"";
									CoworkItemMarkOperation CoworkItemMarkOperation = new CoworkItemMarkOperation();
									CoTypeComInfo CoTypeComInfo = new CoTypeComInfo();
									List labelList=CoworkItemMarkOperation.getLabelList(userid+"","all");          //标签列表
									for(int i=0;i<labelList.size();i++){ 
								         CoworkLabelVO labelVO=(CoworkLabelVO)labelList.get(i);
								         String isUsed=labelVO.getIsUsed();
								         if(isUsed.equals("0")) continue;
								         String id=labelVO.getId();
								         String labelType=labelVO.getLabelType();
								         String labelName=labelVO.getName();
								         if(labelName.equals("17694"))  continue;//过滤掉协作区标签
								         
								         if(labelType.equals("label")){
								      	   labelName=labelVO.getName();
								         }else if(labelType.equals("typePlate")){
								        	   labelName = CoTypeComInfo.getCoTypename(labelVO.getName());
								         }else{
								      	   labelName=SystemEnv.getHtmlLabelName(Util.getIntValue(labelVO.getName()),user.getLanguage());
								         }
								         
								         %>
								         <li readonly="0" class="" data-value="<%=labelType %>"><div><%=labelName %></div></li>
								     <%}%>
								</ul>
						</div>
						<input type="text" require="" fieldlabel="标签 :"
							id="C6EEEF6248B00001D0A9145013F01B74" data-role="none"
							value="" name="fieldname_id" style="display: none;">
					</div>
				</div>

					<div id="fButtons" class="fButtons">
							<div title="搜索" action="1" onclick="doSearch();" class="fButton fSubmitButton">搜索</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!--人员选择-->
	<div id="browserFrames" class="controlHide">
		<iframe id="hrmBrowserFrame" class="st-frame st-frame1 lazy-frame" frameborder="0" scrolling="auto" src="" lazy-src="/mobilemode/apps/browser/hrmBrowser.jsp?noHeader=1&isOpenedOnTopfloor=1"></iframe>
		<iframe id="commonBrowserFrame" class="st-frame st-frame1 lazy-frame" frameborder="0" scrolling="auto" src="" lazy-src="/mobilemode/apps/browser/commonBrowser.jsp?noHeader=1&isOpenedOnTopfloor=1"></iframe>
	</div>
	
</div>
</div>

	</body>
</html>
